package cn.com.shopec.erp.product.entity;

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "TBL_PRODUCT_HISTORY")
public class ProductHistory implements java.io.Serializable {
    /** 主键 **/
    private String id;

    /** 货品信息 **/
    // private Product product;

    /** 货品编号 **/
    private String gNo;

    /** 操作类型 **/
    private Integer opType;

    /** 操作时间 **/
    private Timestamp opTime;

    /** 操作人 **/
    private String opPerson;

    /** 操作前库存数量 **/
    private Long oldQuantity;

    /** 操作后库存数量 **/
    private Long opQuantity;

    /** 删除标识 **/
    private Integer deleteFlag;

    @GenericGenerator(name = "generator", strategy = "uuid.hex")
    @Id
    @GeneratedValue(generator = "generator")
    @Column(name = "ID", unique = true, nullable = false, length = 32)
    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Column(name = "op_type")
    public Integer getOpType() {
        return this.opType;
    }

    public void setOpType(Integer opType) {
        this.opType = opType;
    }

    @Column(name = "op_time")
    public Timestamp getOpTime() {
        return this.opTime;
    }

    public void setOpTime(Timestamp opTime) {
        this.opTime = opTime;
    }

    @Column(name = "op_person")
    public String getOpPerson() {
        return this.opPerson;
    }

    public void setOpPerson(String opPerson) {
        this.opPerson = opPerson;
    }

    @Column(name = "old_quantity")
    public Long getOldQuantity() {
        return this.oldQuantity;
    }

    public void setOldQuantity(Long oldQuantity) {
        this.oldQuantity = oldQuantity;
    }

    @Column(name = "op_quantity")
    public Long getOpQuantity() {
        return this.opQuantity;
    }

    public void setOpQuantity(Long opQuantity) {
        this.opQuantity = opQuantity;
    }

    @Column(name = "delete_flag")
    public Integer getDeleteFlag() {
        return this.deleteFlag;
    }

    public void setDeleteFlag(Integer deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    // @ManyToOne(targetEntity = Product.class, cascade = CascadeType.ALL)
    // @JoinColumn(name = "G_NO", referencedColumnName = "G_NO", insertable =
    // false, updatable = false)
    // public Product getProduct() {
    // return this.product;
    // }
    //
    // public void setProduct(Product product) {
    // this.product = product;
    // }

    @Column(name = "G_NO")
    public String getgNo() {
        return this.gNo;
    }

    public void setgNo(String gNo) {
        this.gNo = gNo;
    }

}
